#include <iostream>
#include <fstream>
#include <unistd.h>
#include "HttpServer.h"

int main() {

    const utility::string_t url = U(SERVER_URL);
    HttpServer server(url);
    server.start();

    const int numThreads = 1;
    std::vector<std::thread> threads;
    for (int i = 0; i < numThreads; ++i) {
        threads.emplace_back([&server]() {
        try {
                server.stop();
                server.start();
            } catch (...) {
	    	std::cout << "thread error " << std::endl;
            }
        });
    }

    for (int i = 0; i < numThreads; ++i) {
        threads[i].join();
    }

    while(1){
    	sleep(1);
    }

    return 0;
}

